"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
exports.__esModule = true;
var Person = /** @class */ (function () {
    function Person(name, age) {
        this.name = name;
        this.age = age;
    }
    Person.prototype.getName = function () {
        return this.name;
    };
    Person.prototype.setName = function (name) {
        this.name = name;
    };
    return Person;
}());
// 实例化类
// let p1 = new Person('zhuzhu',17);
// p1.name = 'gougou'
// console.log(p1,'p1');  // Person { name: 'gougou', age: 17 } p1
// console.log(p1.getName()); // gougou
var Student = /** @class */ (function (_super) {
    __extends(Student, _super);
    function Student(name, age, stuNo) {
        var _this = _super.call(this, name, age) || this;
        _this.stuNo = stuNo;
        return _this;
    }
    Student.prototype.getStuNo = function () {
        console.log(this.stuNo, '获取属性');
        return this.stuNo;
    };
    return Student;
}(Person));
var s1 = new Student('zhufeng', 11, 1);
// 定义存取器
var User = /** @class */ (function () {
    function User(myName) {
        this.myName = myName;
    }
    Object.defineProperty(User.prototype, "name", {
        get: function () {
            return this.myName;
        },
        set: function (value) {
            this.myName = value;
        },
        enumerable: false,
        configurable: true
    });
    return User;
}());
var user = new User('zhufeng');
user.name = 'jiagou';
console.log(user.name);
